-- less_damage_hit1
-- created by wangy
-- 受创x%概率减少x%所受到的伤害

return {
    apply = function(prop, baseValue)
        return prop[3];
    end,

    -- 攻击时触发
    trigger = function(who, prop, arg)
        local damage = arg;
        -- 概率抵挡
        if DungeonM.getRandSeed("LESS_HIT1") % 1000 < prop[3] then
            damage = damage - math.modf(tonumber(prop[2]) * damage / 1000);
        end

        return damage;
    end,

    record = function(target, prop, path)
        return false;
    end
};
